Conversation
dd29f47 to
e62bd32
Compare
6d40da9 to
558617b
Compare
558617b to
c918b4b
Compare
c5c0c6a to
f5fe0a6
Compare
664cf00 to
b756f27
Compare
| @@ -0,0 +1,56 @@ | |||
| # Nilai Auth Server | |||
There was a problem hiding this comment.
Where is this server meant to be ran? Is this running somewhere privately (locally?) that nobody else can hit?
There was a problem hiding this comment.
This is never run by Nillion on a production environment. It is just meant to be an example for FEs on how to run an intermediate service that delegates the subscription to users. I will introduce a better clarification to say this is just a demo example.
| Returns: | ||
| The balance of the user in UNIL | ||
| """ | ||
| print("grpc_endpoint", grpc_endpoint) |
| grpc_endpoint: The endpoint of the grpc server | ||
| """ | ||
|
|
||
| if get_unil_balance(wallet.address(), grpc_endpoint=grpc_endpoint) < 0: |
There was a problem hiding this comment.
You can use nilauth_client.subscription_cost to get the cost and compare more accurately against that (probably add a leeway because of gas).
| @@ -0,0 +1,138 @@ | |||
| from nuc_helpers import ( | |||
There was a problem hiding this comment.
Maybe this file should be called tests, and invoked using pytest
There was a problem hiding this comment.
In fact, with the following PR, I do this, I integrated this code as part of the e2e tests so that all the tests are executing under this scenario.
| @@ -0,0 +1,56 @@ | |||
| # Nilai Auth Server | |||
There was a problem hiding this comment.
I'm wondering if this should be a dev/testing helper library instead of a service, why is it a service?
There was a problem hiding this comment.
Yes, it is meant to be a dev/testing helper library. It is not a service in itself, but is meant to be a guide for FEs or others to implement a B2B2C scenario where a subscription is delegated.
Co-authored-by: Sergio Medina <lumasepa@gmail.com>
This PR includes all the required changes to make sure that nilAI supports authentication with NUCs: